Skip to main content

7.3.1 Create a scan-code payment order with a limited amount of digital currency

#Brief description: Digital currency recharge business interface, users can recharge USDT (Tether) to their digital wallet account (market exchange rate) by scanning the QR code

Request parameters
Parameter nameTypeRequiredParameter meaningParameter description
keystringYesMerchant keyapiKey
localOrderIdstringYesMerchant platform local order numberMerchant platform generates unique order number locally
localUserIdstringNoMerchant platform local user IDMerchant platform local user ID
notifyUrlstringNoCallback addressAfter the order is placed successfully, the merchant's address will be notified by API callback (for callback details, please refer to Document 3)
successRedirectUrlstringNoJump addressAutomatically jump to address after success
currencystringYesCurrencyPricing currency (wallet currency)
userCurrencystringYesCurrencyThe currency that the user needs to pay (the wallet supports digital currencies)
amountnumberYesAmountOrder pricing amount
isBlockchainbooleanNoWhether to return blockchain information (default false)When true, the callback request will carry the transaction information on the order chain
networkLimitsarrayNoMainnetDesignated payment mainnet, such as TRON, BSC, POLYGON, ETHEREUM
expireSecondLongNoExpiration timestamp (seconds)
signstringYesSignatureSee Signature Algorithm for details
Request json sample
{
"key": "dNNTJZpgFVWlYrVv",
"localOrderId": "CONAN-TES1225662",
"userCurrency": "USDT",
"currency": "CNY",
"amount": 10,
"networkLimits": ["TRON", "BSC"],
"sign": "8b949190830deb3acf5fd356f2424c72"
}

Response json example

{
"code": 0,
"success": true,
"message": null,
"data": {
"orderId": 474103463461061,
"localUserId": null,
"localOrderId": "CONAN-TES1225662",
"orderType": "PAYMENT",
"orderBizType": "PAYMENT_FIXED_DIGITAL_SCAN",
"paymentUrl": "https://dxpay.dxstudio.org/fixed-amount-pay/S8hQJJWtWW2GZqLXZc9Nm8Xf32tVDoL44jYqJ59mcrMLy1Zr3RKAu4NVmLzg",
"publicKey": "S8hQJJWtWW2GZqLXZc9Nm8Xf32tVDoL44jYqJ59mcrMLy1Zr3RKAu4NVmLzg",
"currency": "CNY",
"userCurrency": "USDT",
"amount": "10",
"userReceivableAmount": "1.49",
"rate": "6.69220484",
"rateExpression": "1USDT≈6.6922CNY"
}
}

The returned paymentUrl pops up the payment page, as shown below:

![img](/dx-docs/7- 7、数字币代收(充值)/7.3 数字币限定金额扫码支付/usdt.jpg)

Response data parameter description
Parameter nameTypeParameter meaningParameter description
orderIdstringOrder ID
localUserIdstringMerchant local user ID
localOrderIdstringMerchant local order number
orderTypeenumOrder TypePAYMENT:支付订单 | WITHDRAW:提款订单
orderBizTypeenumOrder business typeorderBizType type description is as follows
paymentUrlstringPayment address
publicKeystringKeyPublic Access Key
currencystringOrder currency
userCurrencystringUser payment currency
amountstringOrder amount
userReceivableAmountstringAmount payable by the user
ratestringExchange rate
rateExpressionstringOrder exchange rate expression

orderBizType type description:

  1. PAYMENT_WALLET_SCAN MINPAY wallet scan code payment
  2. PAYMENT_TRANSFER digital currency binding address direct deposit
  3. PAYMENT_ANY_DIGITAL_SCAN Scan the QR code to pay any amount of digital currency
  4. WITHDRAW_WALLET withdraw money to MINPAY wallet
  5. WITHDRAW_ANY_DIGITAL_WALLET Withdraw digital currency to any wallet
  6. PAYMENT_FIXED_DIGITAL_SCAN digital currency limited amount scan code payment
  7. BATCH_PAY batch payment

Callback returns json data

By default, all callback parameters participate in signature verification. For details of callback parameters, please see callback ]

Callback data
{
"amount": 11,
"bizType": "PAYMENT_FIXED_DIGITAL_SCAN",
"blockchain": {
"network": "TRON",
"receiverAddress": "TA1jptT16DssYWVGdVyFWxonku6hWK7En3",
"senderAddress": "TPutFhYUQnrRxHSmKVwjp55vgk9QY6r5nS",
"txId": "24d0d0e5d417bd2195c45d64724760ae47fc3b359ee31c5fedf25b40f3584b36"
},
"currency": "CNY",
"key": "h3cS7dBltRU4W1wD",
"localOrderId": "2820",
"merchantActualAmount": 8.86,
"merchantCurrency": "CNY",
"merchantId": 303122065665,
"merchantPaidAmount": 10.98,
"merchantUserId": "97",
"notifyTime": 1731572168370,
"orderCreateTime": 1731572133082,
"orderId": "273124814912907",
"sign": "699806308a9e055114c378671b0d2a15",
"status": "SUCCESS",
"type": "PAYMENT",
"userAmount": 1.55,
"userCurrency": "USDT",
"userReceivableAmount": 1.55
}

When you receive the callback notification, please directly return the string success after the processing is completed, indicating that the message has been successfully received and processed. After the system receives the success response, it will no longer send the callback repeatedly. If the expected response is not received (success is not returned or an exception is returned), the system will resend the callback notification according to the stepped retry mechanism, retrying up to 14 times. The current retry intervals are: 15s, 15s, 30s,180s, 600s, 1200s, 1800s, 1800s, 1800s,3600s,10800s,10800s,21600s, 21600s